package com.bw.greendao.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.bw.greendao.entity.ShoppEntity;
import com.bw.greendao.entity.UserEntity;

import com.bw.greendao.dao.ShoppEntityDao;
import com.bw.greendao.dao.UserEntityDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig shoppEntityDaoConfig;
    private final DaoConfig userEntityDaoConfig;

    private final ShoppEntityDao shoppEntityDao;
    private final UserEntityDao userEntityDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        shoppEntityDaoConfig = daoConfigMap.get(ShoppEntityDao.class).clone();
        shoppEntityDaoConfig.initIdentityScope(type);

        userEntityDaoConfig = daoConfigMap.get(UserEntityDao.class).clone();
        userEntityDaoConfig.initIdentityScope(type);

        shoppEntityDao = new ShoppEntityDao(shoppEntityDaoConfig, this);
        userEntityDao = new UserEntityDao(userEntityDaoConfig, this);

        registerDao(ShoppEntity.class, shoppEntityDao);
        registerDao(UserEntity.class, userEntityDao);
    }
    
    public void clear() {
        shoppEntityDaoConfig.clearIdentityScope();
        userEntityDaoConfig.clearIdentityScope();
    }

    public ShoppEntityDao getShoppEntityDao() {
        return shoppEntityDao;
    }

    public UserEntityDao getUserEntityDao() {
        return userEntityDao;
    }

}
